/**
 * 
 */

package com.qccx.ueuo.selfguide.action;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts2.interceptor.ServletRequestAware;
import org.apache.struts2.interceptor.ServletResponseAware;
import org.apache.struts2.interceptor.SessionAware;

import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.ModelDriven;
import com.qccx.ueuo.selfguide.service.AreaCommentService;
import com.qccx.ueuo.selfguide.service.AreaService;
import com.qccx.ueuo.selfguide.service.AreaVoiceService;
import com.qccx.ueuo.selfguide.service.CooperationService;
import com.qccx.ueuo.selfguide.service.CooperationTypeService;
import com.qccx.ueuo.selfguide.service.FriendShipService;
import com.qccx.ueuo.selfguide.service.MessageService;
import com.qccx.ueuo.selfguide.service.SpecialtyService;
import com.qccx.ueuo.selfguide.service.SpotCommentService;
import com.qccx.ueuo.selfguide.service.SpotImageService;
import com.qccx.ueuo.selfguide.service.SpotService;
import com.qccx.ueuo.selfguide.service.SpotVoiceService;
import com.qccx.ueuo.selfguide.service.UserPathService;
import com.qccx.ueuo.selfguide.service.UserService;

/**
 * 功能介绍:
 * 
 * @author rainJohn
 * @date [2013-4-28]
 */
public abstract class BaseAction extends ActionSupport implements SessionAware,
        ServletRequestAware, ServletResponseAware, ModelDriven<Object>
{
    /**
     * 
     */
    private static final long serialVersionUID = 1L;

    private HttpServletRequest request = null;
    private HttpServletResponse response = null;
    private AreaCommentService areaCommentService;
    private AreaService areaService;
    private AreaVoiceService areaVoiceService;
    private CooperationService cooperationService;
    private CooperationTypeService cooperationTypeService;
    private FriendShipService friendShipService;
    private MessageService messageService;
    private SpecialtyService specialtyService;
    private SpotCommentService spotCommentService;
    private SpotImageService spotImageService;
    private SpotService spotService;
    private SpotVoiceService spotVoiceService;
    private UserPathService userPathService;
    private UserService userService;

    public AreaCommentService getAreaCommentService()
    {
        return areaCommentService;
    }

    public void setAreaCommentService( AreaCommentService areaCommentService )
    {
        this.areaCommentService = areaCommentService;
    }

    public AreaService getAreaService()
    {
        return areaService;
    }

    public void setAreaService( AreaService areaService )
    {
        this.areaService = areaService;
    }

    public AreaVoiceService getAreaVoiceService()
    {
        return areaVoiceService;
    }

    public void setAreaVoiceService( AreaVoiceService areaVoiceService )
    {
        this.areaVoiceService = areaVoiceService;
    }

    public CooperationService getCooperationService()
    {
        return cooperationService;
    }

    public void setCooperationService( CooperationService cooperationService )
    {
        this.cooperationService = cooperationService;
    }

    public CooperationTypeService getCooperationTypeService()
    {
        return cooperationTypeService;
    }

    public void setCooperationTypeService(
            CooperationTypeService cooperationTypeService )
    {
        this.cooperationTypeService = cooperationTypeService;
    }

    public FriendShipService getFriendShipService()
    {
        return friendShipService;
    }

    public void setFriendShipService( FriendShipService friendShipService )
    {
        this.friendShipService = friendShipService;
    }

    public MessageService getMessageService()
    {
        return messageService;
    }

    public void setMessageService( MessageService messageService )
    {
        this.messageService = messageService;
    }

    public SpecialtyService getSpecialtyService()
    {
        return specialtyService;
    }

    public void setSpecialtyService( SpecialtyService specialtyService )
    {
        this.specialtyService = specialtyService;
    }

    public SpotCommentService getSpotCommentService()
    {
        return spotCommentService;
    }

    public void setSpotCommentService( SpotCommentService spotCommentService )
    {
        this.spotCommentService = spotCommentService;
    }

    public SpotImageService getSpotImageService()
    {
        return spotImageService;
    }

    public void setSpotImageService( SpotImageService spotImageService )
    {
        this.spotImageService = spotImageService;
    }

    public SpotService getSpotService()
    {
        return spotService;
    }

    public void setSpotService( SpotService spotService )
    {
        this.spotService = spotService;
    }

    public SpotVoiceService getSpotVoiceService()
    {
        return spotVoiceService;
    }

    public void setSpotVoiceService( SpotVoiceService spotVoiceService )
    {
        this.spotVoiceService = spotVoiceService;
    }

    public UserPathService getUserPathService()
    {
        return userPathService;
    }

    public void setUserPathService( UserPathService userPathService )
    {
        this.userPathService = userPathService;
    }

    public UserService getUserService()
    {
        return userService;
    }

    public void setUserService( UserService userService )
    {
        this.userService = userService;
    }

    public HttpServletRequest getRequest()
    {
        return request;
    }

    public void setRequest( HttpServletRequest request )
    {
        this.request = request;
    }

    public HttpServletResponse getResponse()
    {
        return response;
    }

    public void setResponse( HttpServletResponse response )
    {
        this.response = response;
    }

    public void responseStr( String str )
    {
        PrintWriter pw = null;
        try
        {
            this.getResponse().setCharacterEncoding( "utf-8" );
            this.getResponse().setContentType( "text/html;charset=UTF-8" );
            pw = this.getResponse().getWriter();
            pw.print( str );
            pw.flush();
        } catch ( IOException e )
        {
            e.printStackTrace();
        } finally
        {
            if ( pw != null )
            {
                pw.close();
            }
        }
    }
}
